<?php

namespace App\V3\V3_2_7\Services;

use App\V3\V3_2_7\Models\CustomerServiceModel;

class CustomerService
{
    /**
     *客服与打印机购买管理
     * Author: zlf
     * Created at 2024/2/28 10:41
     * @param $data
     * @return \Illuminate\Http\JsonResponse
     */
    public static function edit($data)
    {
        $updData = $data;
        if(!empty($data['id'])) {
            $updData['updated_at'] = time();
        }else{
            $data['id'] = '';
            $updData['created_at'] = time();
        }
        CustomerServiceModel::query()->updateOrCreate([
            'id'=>$data['id']
        ],$updData);
        return success();
    }
}
